<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../../axios.js"></script>
</head>

<body>

    <script>
        axios.defaults.baseURL = 'http://localhost:3000'

        axios.defaults.headers['mytoken'] = 'askdaksdkasdlajsdl';

        axios.defaults.headers['Content-Type'] = 'application/x-www-form-urlencoded'


        axios.get('/axios', {
            params: {
                id: 1
            }
        }).then((data) => {
            console.log(data.data)
        })

        axios.get('/axios/1')
            .then((data) => {
                console.log(data.data)
            })

        axios.post('/axios', {
            uname: 'wzp',
            pwd: 123456
        }).then((data) => {
            console.log(data.data)
        })

        axios.put('/axios/11', {
            uname: 'wzp',
            pwd: 123456
        }).then((data) => {
            console.log(data.data)
        })
        axios.get('/axios/1').then((data) => { console.log(data.data) })
    </script>
</body>

</html>